package com.gehj.uhttp;

import android.content.Context;

import com.google.gson.Gson;

import okhttp3.OkHttpClient;


/**
 * Created by Administrator on 2016/8/3.
 */
public class Singleton {
    private static OkHttpClient client = null;
    private static OkHttpClient.Builder clientBuilder = null;
    private static Gson gson = null;


    public static OkHttpClient getOkhttpClientInstance() {
        if (client == null) {
            client = new OkHttpClient();
        }
        return client;
    }


    public static OkHttpClient.Builder getOkhttpClientBuilderInstance() {
        if (clientBuilder == null) {
            clientBuilder = new OkHttpClient().newBuilder();
        }
        return clientBuilder;
    }

    public static Gson getGsonIntance(){
        if (gson == null) {
            gson = new Gson();
        }
        return  gson;
    }


}
